function createSphere(radius, segments,img) {
    return new THREE.Mesh(new THREE.SphereGeometry(radius, segments, segments), new THREE.MeshPhongMaterial({
        map: THREE.ImageUtils.loadTexture(img),
        bumpScale: 0.05,
        specular: new THREE.Color('#190909'),
        emissive:0x666666
    }));
}

function createSphere_0(radius, segments,img){
    return new THREE.Mesh(new THREE.SphereGeometry(radius, segments, segments),new THREE.MeshLambertMaterial( {
        map: THREE.ImageUtils.loadTexture(img) ,
        emissive:0xffffff
    }));
}

function createSolarSky(radius, segments) {
    return new THREE.Mesh(new THREE.SphereGeometry(radius, segments, segments), new THREE.MeshBasicMaterial({
        map: THREE.ImageUtils.loadTexture('images/galaxy_starfield.jpg'),
        side: THREE.BackSide
    }));
}

function createRings(radius, segments) {
    var ring = new THREE.Mesh(new THREE.RingGeometry(1.2 * radius, 2 * radius, 2 * segments, 5, 0, Math.PI * 2), new THREE.MeshBasicMaterial({
        map: THREE.ImageUtils.loadTexture('images/ring.png'),
        side: THREE.DoubleSide,
        transparent: true,
        emissive:0xffffff
    }));
    return ring;
}

function createOrbit(radius, segments,angle,opacity){
    //innerRadius, outerRadius, thetaSegments, phiSegments, thetaStart, thetaLength
    var orbit = new THREE.Mesh(new THREE.RingGeometry(radius,  radius+20, 500, 5, 0, Math.PI * 2), new THREE.MeshBasicMaterial({
        map: THREE.ImageUtils.loadTexture('images/ring.jpg'),
        side: THREE.DoubleSide,
        transparent: true,
        opacity: opacity,
        emissive:0xffffff
    }));
    return orbit;
}

function createSprits(color,img){
    console.log("ssss");
    return new THREE.Sprite(new THREE.SpriteMaterial(
        {
            map: new THREE.ImageUtils.loadTexture( img ),
            useScreenCoordinates: false, alignment: THREE.SpriteAlignment.center,
            color: color, transparent: true, blending: THREE.AdditiveBlending
        }));
}